package com.logictech.lims.dao.impl;

import java.util.List;

import org.jeecgframework.p3.core.utils.common.PageQuery;
import org.jeecgframework.p3.core.utils.common.PageQueryWrapper;
import org.jeecgframework.p3.core.utils.persistence.mybatis.GenericDaoDefault;
import org.springframework.stereotype.Repository;
import com.logictech.lims.dao.ExperimentMaterialDao;
import com.logictech.lims.dto.ExperimentMaterialDto;
import com.logictech.lims.entity.ExperimentMaterial;

/**
 * 描述：</b>ExperimentMaterialDaoImpl<br>
 * @author：guoqi
 * @since：2017年04月22日 10时21分18秒 星期六 
 * @version:1.0
 */
@Repository("experimentMaterialDao")
public class ExperimentMaterialDaoImpl extends GenericDaoDefault<ExperimentMaterial> implements ExperimentMaterialDao{

	@Override
	public Integer count(PageQuery<ExperimentMaterial> pageQuery) {
		return (Integer) super.queryOne("count",pageQuery);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<ExperimentMaterial> queryPageList(
			PageQuery<ExperimentMaterial> pageQuery,Integer itemCount) {
		PageQueryWrapper<ExperimentMaterial> wrapper = new PageQueryWrapper<ExperimentMaterial>(pageQuery.getPageNo(), pageQuery.getPageSize(),itemCount, pageQuery.getQuery());
		return (List<ExperimentMaterial>)super.query("queryPageList",wrapper);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<ExperimentMaterialDto> queryByExperimentId(String experimentId) {
		return (List<ExperimentMaterialDto>)super.query("queryByExperimentId",experimentId);
	}
	
	@Override
	public ExperimentMaterialDto queryById(String id) {
		return (ExperimentMaterialDto)super.queryOne("queryById",id);
	}

}

